package com.ionehe.esjob;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import com.ionehe.annotation.ElasticJobConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@ElasticJobConfig(
        name = "com.ionehe.esjob.TestJob",
        cron = "0/5 * * * * ?", //5秒钟一次
        description = "测试定时任务",
        overwrite = true,
        shardingTotalCount = 5
)
@Slf4j
public class TestJob implements SimpleJob {
    @Override
    public void execute(ShardingContext shardingContext) {
        log.info("执行测试job");
    }
}